/*    */ package server;
/*    */ 
/*    */ import com.alibaba.druid.pool.DruidPooledConnection;
import database.DatabaseConnection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import tools.DateUtil;

import java.sql.PreparedStatement;
import java.sql.SQLException;

/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */ 
/*    */ public class AutoExecuteTask
/*    */ {
/* 13 */   private static final Logger log = LogManager.getLogger();
/*    */ 
/*    */ 
/*    */   
/* 17 */   private static int[] missionList = new int[] { 100100 };
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   public static void execute() {
/* 23 */     Timer.WorldTimer.getInstance().register(() -> {
/*    */           for (int missionId : missionList) {
/*    */             try(DruidPooledConnection con = DatabaseConnection.getInstance().getConnection(); PreparedStatement ps = con.prepareStatement("DELETE FROM missionstatus WHERE missionid = ?")) {
/*    */               ps.setInt(1, missionId);
/*    */ 
/*    */ 
/*    */ 
/*    */               
/*    */               ps.executeUpdate();
/* 32 */             } catch (SQLException e) {
/*    */               
/*    */               log.error("自动清除任务数据失败", e);
/*    */             } 
/*    */           } 
/* 37 */         },86400000L, DateUtil.getNextDayDiff(1));
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\server\AutoExecuteTask.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */